import os
from flask import Flask

from apps.common.script import init_script
from apps.config import BaseConfig
from apps.views import init_bps
from apps.extensions import init_plugs
def create_app():
    app = Flask(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
    # 引入配置
    app.config.from_object(BaseConfig)
    # 注册flask组件
    init_plugs(app)
    # 注册蓝图
    init_bps(app)
    # 注册命令
    init_script(app)
    return app